	<?php
	$roomID = $_GET["roomID"];
	$mode = $_GET['mode'];
	
	$con = mysql_connect("localhost","root","");
	if (!$con) {
		die('Could not connect: ' . mysql_error());
	}
	mysql_select_db("ciu196", $con);
	
	$sql = "
	UPDATE rooms 
	SET mode = '$mode'
	WHERE roomID =  '$roomID';";
	
	$res = mysql_query($sql,$con);	
	if(!$res) {
		die('Error: couldnt change mode' . mysql_error());
	} else {
		echo "Changed mode";
	}
	
	mysql_close();
?>